#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include "QSerialPort" //串口访问
#include "QSerialPortInfo" //串口端口信息访问
#include <QTimer>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    QSerialPort *SerialPort;
    QStringList portNameList;
    QTimer *readDataTimer;
    QByteArray revBuf;
    bool isOpen;

    void searchCom(void);

    Widget(QWidget *parent = nullptr);
    ~Widget();


public slots:
    void readDataTimeOut(void);

private slots:
    void readData(void);

    void on_btn_sendData_clicked();

    void on_btn_clearSend_clicked();

    void on_btn_clearShow_clicked();

    void on_btn_Switch_clicked();

    void on_btn_searchCom_clicked();

private:
    Ui::Widget *ui;
};
#endif // WIDGET_H
